package com.hm.prac2;

public class Person {
    private static int age = 40;
    public static int num0 = 39;
    public int num1 = 38;
    //成员内部类
    public class Heart {
        public int num1 = 37;
        public static int num0 = 45;

        public void test1() {
            age = 59;
            System.out.println(age);
            System.out.println(num0);
            System.out.println(Person.num0);
            System.out.println(num1);
            System.out.println(this.num1);
            //拿到的是外部类的重名变量的值
            System.out.println(Person.this.num1);
        }
    }
    //静态内部类
    public static class Gastric{
        public void test(){
            System.out.println(num0);
            //因为静态内部类是外部类的属性，所以访问不到外部类对象的属性，但是可以访问都外部类的属性
//            System.out.println(num1);
        }
    }
    public void create(){
        Gastric gastric = new Gastric();
        Heart heart = new Heart();
    }

}
